import React, { useState } from 'react'
import './SearchInput.css'
import imgSearch from '@/assets/images/search.png'
import imgLocation from '@/assets/images/up.png'
import imgLogo from '@/assets/images/logo.png'
import MainPop from '../../main/mainPop/MainPop'
import imgJiahao from '@/assets/images/加号.png'

const SearchInput = (props) => {
    // const { SearchBoxhandleOnclick } = props;
    // const [showPop, setShowPop] = useState(false)
    // const handleOnclick = () => {
    //     // popup 组件的显示？
    //     setShowPop(!showPop)
    // }
    const { handleOnclick, SearchBoxhandleOnclick }= props;
    return (
        <div className="topbar">
            <div className="topbar-left">
                <p className="location">南昌</p>
                <img src={imgLocation} className="location-img" />
            </div>
            <div className="topbar-center">
                <div className="topbar-center_container">
                    <div className="search-img">
                        <img src={imgSearch} />
                    </div>
                    <input type="text" placeholder='输入商家名、品类或商圈' onFocus={SearchBoxhandleOnclick} />
                </div>
            </div>
            <div className="topbar-right">
                {/* <img src={imgLogo} className="logo-img" /> */}
                {/* <MainPop handleOnclick={ handleOnclick} display={showPop} /> */}
                <img src={imgJiahao} onClick={()=>{handleOnclick()}}></img>
            </div>
        </div>
    )
}

export default SearchInput